import yaml
from yaml import FullLoader
from parser.md_parser import md2html
from provider.docx_processor import DocxProcessor


def main(md_path: str, docx_path: str, style_conf: dict={}):
    if not style_conf:
        with open('src/config/default_style.yaml', "r", encoding="utf-8") as file:
            style_conf = yaml.load(file, FullLoader)
    html_path = md_path.replace('.md', '.html')
    md2html(md_path, html_path)
    DocxProcessor(style_conf=style_conf).html2docx(html_path, docx_path)



if __name__ == '__main__':
    main('test/example.md', 'test/example.docx')
